local hx__yiji = fk.CreateSkill {
  name = "hx__yiji",
}

hx__yiji:addEffect(fk.Damaged, {
  anim_type = "masochism",
  trigger_times = function(self, event, target, player, data)
    return data.damage
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    player:drawCards(1, hx__yiji.name)
    if player.dead or player:isKongcheng() then return end
    player.room:askToYiji(player, {
      cards = player:getCardIds("he"),
      targets = room:getOtherPlayers(player),
      skill_name = hx__yiji.name,
      min_num = 0,
      max_num = 2
    })
  end,
})

return hx__yiji